********************************************************************************************
RenAlert Scripts...
By Tom "Dante" Anderson
Dante@planetcnc.com
********************************************************************************************


**********************************************************************************************


Script Name:	"RA_Thief_Script"

Desc:			Thief Script, very useful indeed..., will award however many credits to whichever team owns the thief.

Script Parameters:
				Credits_To_Award=500:float
				Prevent_Theft_Timer=30:float
				Thief_Preset_ID:string

Notes:			Set this on a zone, will trigger on zone entry.
				The Thief_Preset_ID should be the ID of the thief preset
				
				
**********************************************************************************************

Script Name:	"RA_Soviet_Defence"

Desc:			Base Defense Script, to ignore the Spy (use for Soviets only)

Script Parameters:
				MinAttackDistance=0:float
				MaxAttackDistance=300:float
				AttackTimer=10:float
				Spy_Preset_ID:string
				Aircraft_Preset_ID:string

Notes:			Set this up exactly like M00_Base_Defense, but will ignore the spy and aircraft.

				
**********************************************************************************************	

Script Name:	"RA_Repair_Controler"

Desc:			Service Depot building controler script

Script Parameters:
			ScriptZoneID=0:int

Notes:			Stick this on the building controler for the repair bay

				
**********************************************************************************************	

Script Name:	"RA_Repair_Script"

Desc:			Repair Zone script

Script Parameters:
			TeamSelection=0:int

Notes:			Stick this on the repair bay zone to make it repair. It is hardcoded to only repair presets whos ID matches that of the land vechicles in RenAlert.
			Use JFW_Repair_Bay & fiends for a more generic script.

				
**********************************************************************************************	

********************************************************************************************
RenAlert Scripts
By Joshua "NeoSaber" Kraft
********************************************************************************************

**********************************************************************************************	

Script Name: "RA_Allied_Thief"


Description:

A new script for the thief, it grants the thief's team credits when he enters a zone with the script "RA_Soviet_Refinery_Theft_Zone", as well as every 30 seconds (by default, this can be changed) the thief remains inside the zone.

Script Parameters:

-Credits_To_Award: How many credits the thief gets per theft. The default amount is 500.00

-Prevent_Theft_Timer: How many seconds to wait between thefts. Default is 30.00

Notes: 

This script is attached to the preset for whatever soldier is being used as the thief

**********************************************************************************************	

Script Name: "RA_Soviet_Refinery_Theft_Zone"


Description:

This script works in conjunction with the script "RA_Allied_Thief". It checks when a thief enters or exits a zone and sends the thief a custom. Also, when it receives a custom from the script "RA_Soviet_Refinery_Controller" it will stop sending the thief a message when entered

Script Parameters:

-Thief_Preset_ID: This is the preset ID for the thief. Default is 0

Notes: 

This script is attached to a script zone. Where ever the script zone is placed is where the thief has to go to steal.

**********************************************************************************************	

Script Name: "RA_Soviet_Refinery_Controller"


Description:

This script is designed to tell the script "RA_Soviet_Refinery_Theft_Zone" when the building it is attached to has been destroyed.

Script Parameters:

-ScriptZoneID: This is the ID of the script zone with "RA_Soviet_Refinery_Theft_Zone". This is NOT the preset ID, it is the ID of the zone placed on the map. Default is 0

Notes:

This script is attached to a building controller, for example the refinery a thief can steal from.

**********************************************************************************************	

Script Name: "RA_Infantry_Spy"


Description: 

This script makes the soldier it is attached to invisible to base defenses. 

Script Parameters: 

None

Notes: 

This script is attached to the preset for whatever soldier is a Spy

**********************************************************************************************	

Script Name: "RA_Infantry_NotSpy"


Description:

This script makes the soldier it is attached to visible to base defenses. This is necessary because the 'invisibility' of the script "RA_Infantry_Spy" is actually given to the player who bought the soldier and not the soldier itself. This means that if a player bought a spy and then bought another type of soldier, they would still be invisible to base defenses. This script corrects that.

Script Parameters:

None

Notes: 

This script is attached to the preset of every soldier that is NOT a Spy, unless that soldier can never be purchased by a player that can purchase a spy. For example, an allied player can buy a Spy, so all allied infantry that are not spies need this script. However, since a soviet player can never be a spy, no Soviet infantry need this script.

**********************************************************************************************	

Script Name: "RA_Helipad_Zone"


Description: 

This script is designed to reload the ammunition of specified vehicles.

Script Parameters:

-TeamSelection: Determines which team this zone works for. 0 = Soviet, 1 = Allied

-Reload_Interval: Interval between individual reloads. Time is in seconds, default is 2.00. This allows for slowly reloading a vehicle, like a repair script slowly repairs a vehicle.

-Apache_Preset_ID: This is the preset ID of a vehicle that will be reloaded by the powerup specified by Apache_Reload_Powerup. Default is 0

-Apache_Reload_Powerup: This is the preset name of a powerup that will be granted to a vehicle matching the Apache_Preset_ID parameter. Default is 'Blank'

-Hind_Preset_ID: This is the preset ID of a vehicle that will be reloaded by the powerup specified by Hind_Reload_Powerup. Default is 0

-Hind_Reload_Powerup: This is the preset name of a powerup that will be granted to a vehicle matching the Hind_Preset_ID parameter. Default is 'Blank'

Notes: 

Script is attached to a script zone. It's setup for the option to allow slow reloads, but can be used for instant refills by specifying a powerup that refills all the ammunition instead of a limited amount.

**********************************************************************************************	

Script Name: "RA_Mine_Layer"


Description: 

This script is designed to be attached to a mine laying vehicle.

Script Parameters:

-Mine_Manager_ID: This is the instance ID of the object with the script RA_Mine_Manager

Notes: 

This script detects when the driver does 0.0 damage to the vehicle. The weapon on the vehicle needs to be setup properly to allow for this.

**********************************************************************************************	

Script Name: "RA_Mine"


Description: 

This script determines if a mine is anti-personnel and/or anti-tank. If the appropriate enemy target comes in to range, the mine self destructs. When destroyed it sends a custom to the Mine Manager.

Script Parameters:

-Mine_Manager_ID: This is the instance ID of the object with the script RA_Mine_Manager. Default is 0.

-Is_Anti-Personnel: Determines if this will blow up on soldiers. 0 = no, 1 = yes

-Is_Anti-Tank: Determines if this will blow up on vehicles. 0 = no, 1 = yes

-Trigger_Damage: Amount of damage to destroy the mine with. Default is 1.0

-Trigger_Warhead:  Name of warhead type used when destroying the mine. Default is "Death"

Notes: 

This script should be attached to a vehicle. It uses the SightRange of the vehicle as the proximity range for triggering the mine.

**********************************************************************************************	

Script Name: "RA_Mine_Manager"


Description:

This script approves all mine placements, keeps track of the amount of mines in use, and ensures that Soviets can only place soviet mines and Allies can only place allied mines even if a player steals the other team's mine layer.

Script Parameters:

-Allied_Mine: Preset name for the Allied team's land mine. 

-Soviet_Mine: Preset name for the Soviet team's land mine. 

-Mine_Reload: Preset name for the powerup used to refund one 'shot' in the Mine Layer if a mine laying request is denied.

-BoneName: This is the name of the bone on the Mine Layer to create a mine at. Defalut is "mine"

-Mine_Limit: This is the team mine limit. It applies seperately to each team. Default is 30

Notes: 

This script should be attached to an invisible object, such as a Daves Arrow. When placed on a map, its ID must match (or be changed to match) the Mine_Manager_ID param on the RA_Mine_Layer and RA_Mine scripts.

**********************************************************************************************	

Script Name: "RA_ObjectDeath_OnCreate"


Description:

This script is designed to create a new object at the location of another object's creation, then kill the script generated object to make use of its KilledExplosion setting to place a sound on the map.

Script Parameters:

-Object: The preset name of the object to be created and destroyed. Default is "null"

Notes: 

The script should be attached to an object, such as a soldier, so that when it is created the object in the script parameter is created and destroyed. If used for its intended purpose (creating sounds) the script created object should be have no model, and the explosion used for its KilledExplosion setting should have no model and be damageless.

**********************************************************************************************	

Script Name: "RA_Naval_Yard"


Description: 

This script tracks the purchasing of units from an object using the script RA_Naval_PT. It approves requests for units, keeps track of it's team's unit count, and destroys objects that request new units after ther building it is attached to is destroyed.

Script Parameters:

-Limit: The team's limit for the units tracked by this script. Default is 8.

-Disable_Time: This is the amount of time, after a unit is bought, that no unit may be purchased. This is to allow a newly purchased vehicle time to get out of the construction zone. Time is measured in seconds. Default is 5.0.

Notes: 

Currently there is nothing to actually make the unit leave the zone, a player has to come and remove it. Because of this, Disable time should be set to an amount that gives a player a decent amount of time to reach the vehicle they purchased.

**********************************************************************************************	

Script Name: "RA_Naval_PT"


Description: 

This script acts as the new 'purchase terminal'. It checks when a player enters the object it is attached to, requests purchase of a unit specified in the parameters, and carries out the unit construction when told to. It basically acts as the intermediary between all the other naval scripts, which unfortunately gives it the most parameters to fill out.

Script Parameters:

-Preset_Name: The preset name of the unit to be purchased from this terminal. Defeault is 'blank'

-Cost: How much the unit costs. Default is 0.0

-Team: which team this Terminal belongs to. 0 = Soviet, 1 = Allied. Default is 0

-ControllerID: The instance ID of the building controller this terminal should contact for purchase requests (Building controller would have script RA_Naval_Yard on it). Default is 0.

-ZoneID: The instance ID of the script zone to construct new units at. (Script zone would have the script RA_Naval_Construction_Zone on it) Default is 0.

-TestID: This parameter is used during gameplay to carry information to recreated terminals.  Leave it at its default of 0 otherwise maps using this script may crash.

Notes: 

This script should be setup on an object that has vehicle transitions (players can get in and out of it). When entered the terminal destroys itself and creates a new one in its place. This 'kicks out' the player so they don't remain in a terminal. 

**********************************************************************************************	

Script Name: "RA_Naval_PT_Pokable"


Description: 

Basically a clone of RA_Naval_PT, this script also acts as the new 'purchase terminal'. It checks when a player pokes the object it is attached to, requests purchase of a unit specified in the parameters, and carries out the unit construction when told to. It basically acts as the intermediary between all the other naval scripts, which unfortunately gives it the most parameters to fill out.

Script Parameters:

-Preset_Name: The preset name of the unit to be purchased from this terminal. Defeault is 'blank'

-Cost: How much the unit costs. Default is 0.0

-Team: The team this Terminal belongs to. 0 = Soviet, 1 = Allied. Default is 0

-ControllerID: The instance ID of the building controller this terminal should contact for purchase requests (Building controller would have script RA_Naval_Yard on it). Default is 0.

-ZoneID: The instance ID of the script zone to construct new units at. (Script zone would have the script RA_Naval_Construction_Zone on it) Default is 0.

Notes: 

This script uses the 'poked' function instead of customs sent by entering a vehicle like its predecessor. It should be attached to an object that is not a 'vehicle' so it can properly use this function. 'Poke' does not work in multiplayer with a normal Renegade installation.
If both the server and the client have scripts.dll 1.9/bhs.dll installed however, it will work.

**********************************************************************************************	

Script Name: "RA_Naval_Unit"


Description:

This script is attached during gameplay to units purchased through the RA_Naval_PT script. It allows the unit to inform the controller of its demise.

Script Parameters:

-ControllerID: The ID of a building controller to send a custom to when this script is destroyed (unit it is attached to dies)

Notes: 

This script shouldn't be attached to anything. The script RA_Naval_PT will attach it automatically to units it contructs as well as fill in the script parameters.

**********************************************************************************************	

Script Name: "RA_Naval_Zone"


Description: 

This script is designed to create an explosion at its location when it receives the appropriate message from the script RA_Naval_PT.

Script Parameter:

-Explosion: This is the preset name of the explosion to use. Default is 'blank'

Notes: 

This script, although originally designed for a script zone, should now be attached to a Dave's Arrow to get full functionality. It will trigger its explosion just prior to a unit being constructed at its location, so the explosion should be capable of killing anything in the way. An example of this would be the explosion having a Death warhead, do 1000 damage in a 4 meter radius, and the damage not being scaled. If attached to an object, like a Dave's arrow, instead of a script zone, the vehicle will be created facing the same direction of as the Dave's Arrow. 

**********************************************************************************************	

Script Name: "RA_Damaged_Credits"


Description:

This script is designed to award credits to the player who damages the object this script is attached to. It does so based on the Damage dealt divided by the script parameter Divisor. It has also been updated to award credits to players that heal the object this script is attached to.

Script Parameter:

-Divisor: This is the number that the damage is divided by to determine the amount of credits to award. Default is 4.0.

Notes: 

This script can be attached to a soldier, vehicle, or any other object you waant to get extra credits from when its damaged.

**********************************************************************************************	

Script Name: "RA_GameStart_Detector"


Description: 

This script is designed to detect when a game actually begins on an FDS. It has been shown that an FDS will start running scripts while still in a "Gameplay Pending" state before players have loaded into the game. This can cause problems for some scripts that run off timers or do something when first created. This script is designed to send a message when normal gameplay starts. Other scripts can be setup to listen for this message, so they know when the game has started.

Script Parameters:

-Interval: This is the delay in seconds between times that the script will check if gameplay has started, so as not to risk overburdening a server. Default is 5.0.

-ReceiverID: ID of the object to send the message to. Default is 0

-Message: This is the message to send. Default is 0

-Parameter: This is an extra parameter that can be sent with the message. Default is 0

Notes: 

This script should be attached to a Dave's Arrow

**********************************************************************************************	

Script Name: "RA_DriverDeath"


Description: 

Half a second after being attached to an object, this script will kill whatever it was attached to.

Script Parameters:

None

Notes: 

This script should be attached to an object by other scripts during gameplay to kill that object after a time delay.

**********************************************************************************************	

Script Name: "RA_Conyard_Controller"


Description: 

This script is largely a clone of TDA_Conyard_Controller. It has been modified so that it will activate the repair scripts at the beginning of a game, and then disable them when the controller it is attached to dies. This allows the repair script "RA_Conyard_Repair" to function from the preset of an object instead of being attached on a per map basis. This script, however, does still need to be attached on a per map basis so it knows all the IDs it needs to.

Script Parameters:

-Building1_ID: 1st building to enable/disable

-Building2_ID: 2nd building to enable/disable

-Building3_ID: 3rd building to enable/disable

-Building4_ID: 4th building to enable/disable

-Building5_ID: 5th building to enable/disable

-Building6_ID: 6th building to enable/disable

-Building7_ID: 7th building to enable/disable

-Building8_ID: 8th building to enable/disable

-Building9_ID: 9th building to enable/disable

-Building10_ID: 10th building to enable/disable

Notes: 

This script should be attached to a building controller. Multiple copies of this script can be attached to a single controller if more parameters are needed.

**********************************************************************************************	

Script Name: "RA_Conyard_Repair"


Description: 

Primarily a clone of TDA_Conyard_Repair, but designed to work with RA_Conyard Controller so this script can function from a preset.

Script Parameter: 

-Repair_Frequency: How often the buiding receives 1 health point. Time is in seconds. Default is 1.0

Notes: 

This script should be attached to the preset of a building controller. If activated by RA_Conyard_Controller, it will continue to repair the builing until disabled. 

**********************************************************************************************	

Script Name: "RA_ObjectDeath_OnDeath"


Description:

When the object this script is attached to is killed, this scripts creates and kills an object at that location. The purpose is to avoid having to use the KilledExplosion setting on a soldier, which may not work correctly in multiplayer games.

Script Parameter:

-Preset: The preset name of the object to create and then kill.

Notes: 

The script uses 100 damage and a BlamoKiller warhead to kill the object it creates. With the standard Renegade armor.ini, BlamoKiller magnifies damage a thousand times against all armor types.

**********************************************************************************************	

Script Name: "RA_Demolition_Truck_Improved"


Description:

An improved version of the original Demolition Truck script for Renegade Alert. This script can work entirely from presets, unlike older versions. All script parameters are defaulted to Renegade Alert requirements.

Script Parameters: 

-Explosion: The vehicle/infantry damaging explosion to use when the vehicle detonates. This script does not make use of any fixes for Explosion script commands, so this explosion will be invisible to all clients. The KilledExplosion of the vehicle is intended to be used for the visual, but harmless effect. Default is Explosion_Invis_Nuke

-Warhead: The warhead to use when damaging buildings. Default is Nuke

-DamageStrength: The base strength of the explosion, this will be scaled down the further away the target building is. It is recommended that it matches the damage strength of the explosion used in the Explosion parameter. Default is 480.0

-DamageRadius: Maximum distance, in meters, that will be effected by the damage. Default is 120.0

Notes:

This script triggers 'the bomb' by detecting when the driver has damaged the vehicle. When triggered, the script uses 100 damage and a Death warhead to kill the truck. When killed, if the truck has a driver it attaches the script RA_Driver_Death to the driver. 

**********************************************************************************************	

Script Name: "RA_CTF_Zone"


Description:

A copy of Dante's TDA_CTF_Zone, that replaces the ID requirement with new code that can find building controllers on it own. It also disables the capture sounds code, which isn't currently being used for Renegade Alert.

Script Parameters:

-Team_ID: This is what team the Script Zone works for. (0=Soviet, 1=Allied). Default is 0.

-Max_Capture: This is the number of captures that will end the game. Default is 5.

-Flag_Preset_Name: This is the flag preset name.

Notes:

This script is used the same way TDA_CTF_Zone was used.

**********************************************************************************************	

Script Name: "RA_MAD_Tank_Improved"


Description:

An improved version of the original MAD Tank script for Renegade Alert. This script is 'self contained', requiring no other scripts being setup up and can work entirely from presets, unlike older versions. All script parameters are defaulted to Renegade Alert requirements.

Script Parameters:

-Attach_Model: This is the name of the .w3d model that will be attached to the model when deployed. Do not include the .w3d in the name. Default is pistons

-Deployed_Animation: This is the full animation name for the deployed animation. The tank will detonate when this animation completes. Default is V_SO_MADTANK.ANIM_MADTANK

-Sonic_Preset: This is the preset name of the object that will be created and destroyed when the tank detonates. The KilledExplosion of this object should be both the visual effect and the infantry/vehicle damaging part of the explosion. Default is Sonic_Box

-Percentage: This is the percentage of a building's maximum health that the tank should damage with 1.0 being 100% damage. Damage is not scaled down by distance, so even at maximum range the damage is the same as being right next to the blast. Default is 0.34.

-Warhead: This is the warhead to damage buildings with. Default is Sonic.

-DamageRadius: Maximum distance, in meters, that will be effected by the damage. Default is 250.0

-Announcement: A 2D sound preset to play when the tank deploys. Default is MAD_Tank_Deployed

Notes:

This script deploys the tank when it detects the driver has damaged the vehicle. Unlike the older script, it doesn't automatically kick out the driver. When the driver gets out, if they do, the tank's transitions will be disabled and the tank's team type will be changed to match the driver's instead of staying unteamed like a normal empty vehicle. The deploy sound does not work with a normal installation of Renegade.
If both the server and the client have scripts.dll 1.9/bhs.dll installed however, it will work.

**********************************************************************************************	

Script Name: "RA_Conyard_Controller_Improved"


Description:

A replacement for RA_Conyard_Controller that can work from presets instead of needing to be setup on a per map basis. It can find all the team's building controller's on its own but require the preset names of 'vehicle type' base defenses, such as AA Guns or Pillboxes. This script works in tandem with RA_Conyard_Repair, by sending messgaess to all building controllers and listed presets on its team. It does not send a message to itself.

Script Parameters:

-Team: The team this script works for. Default is 0

-Preset1: The preset name of an object to repair. Default is blank

-Preset2: The preset name of an object to repair. Default is blank

-Preset3: The preset name of an object to repair. Default is blank

-Preset4: The preset name of an object to repair. Default is blank

-Preset5: The preset name of an object to repair. Default is blank

Notes:

If more than 5 presets are required for extra objects, it is not recommended that another instance of this script be attached to the controller since it would send the message to all building controllers twice, possibly causing issues. It would be better to use the original RA_Conyard_Controller script to fill in the extra object IDs on a per map basis.

**********************************************************************************************	

Script Name: "RA_Building_DeathSound"


Description:

This script plays a 3D sound preset when the object it's attached to reaches certain health percentages. Script parameters are defaulted to Renegade Alert requirements.

Script Parameters:

-HalfSound: Sound preset to play when at 50% health. Default is ExploSound_Bldg_Half

-DeadSound: Sound preset to play when at 0% health. Default is ExploSound_Bldg_Dead

Notes: 

This script won't function in multiplayer with a normal Renegade installation.
If both the server and the client have scripts.dll 1.9/bhs.dll installed however, it will work.

**********************************************************************************************
